﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;

namespace ISS.Models
{
    public class Album
    {
        public enum ALBUM_PERMISSION { PUBLIC = 0, PROCTECTED = 1, PRIVATE = 2 };
        [Key]
        public int AlbumId { get; set; }
        public String AlbumName { get; set; }
        public String AlbumAlias { get; set; }
        public byte Permission { get; set; }
        public String Thumbnail { get; set; }
        public int NumbersOfImage { get; set; }
        public int ViewCount { get; set; }
        public DateTime CreateDate { get; set; }
        public int Like { get; set; }
        public String EmbedHtml { get; set; }
        public int Creator { get; set; }
        public String Tags { get; set; }
        [ForeignKey("Creator")]
        public virtual Users User { get; set; }
        public virtual ICollection<Images> Images {get;set;}
        [NotMapped]
        public int ImageCount { get; set; }
        [NotMapped]
        public int CommentCount { get; set; }
    }

    public class AlbumConfiguration : EntityTypeConfiguration<Album>
    {

        public AlbumConfiguration()
            : base()
        {
            
            HasKey(p => p.AlbumId);
            ToTable("Album");
        }

    }
}